import 'package:boss/ui/page/takeoutManagement/page/afterSaleList/after_sale_list_page.dart';
import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:boss/ui/widget/label_button.dart';
import 'package:flutter/material.dart';
import 'package:hi_common/hi_common.dart';
import 'package:provider/provider.dart';
import 'package:router/annotation.dart';

import 'provider/takeout_list_provider.dart';
import 'widget/takeout_list_browser.dart';

@RouterConfig(TakeoutListPage.pageName)
class TakeoutListPage extends StatefulWidget {
  static const pageName = '/TakeoutListPage';

  @override
  _TakeoutListPageState createState() => _TakeoutListPageState('外卖明细');
}

class _TakeoutListPageState extends BaseState<TakeoutListPage> {
  _TakeoutListPageState(String pageName) : super(pageName);

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (context) => TakeoutListProvider(),
      child: Scaffold(
        appBar: CenterTitleAppBar(
          title: '外卖明细',
          actions: <Widget>[
            LabelButton(
              title: '售后记录',
              onTap: () {
                Navigator.pushNamed(context, AfterSaleListPage.pageName);
              },
            ),
          ],
        ),
        body: TakeoutListBrowser(),
      ),
    );
  }
}
